import request from "@/api/request.js"
import {usetokenstore} from "@/store/token.js";

export const loginService=(loginData)=>{
    const params = new  URLSearchParams();
    for (let key in loginData){
        params.append(key,loginData[key])
    }

    return request.post("/user/login",params)
}

export const registerService=(registerData)=>{
    const params = new URLSearchParams();
    for (let key in registerData){
        params.append(key,registerData[key])
    }

    return request.post("/user/register",params)
}

export const ifCodeRightService=(Code)=>{
    const params = new URLSearchParams();
    params.append("Code",Code)
    return request.post("/user/codeRight",params)
}

export const sendEmail=(email)=>{
    const params = new URLSearchParams();
    params.append("email",email);
    return request.post("/user/sendEmail",params)
}

export const ifExist=(email)=>{
    const params = new URLSearchParams();
    params.append("email",email)
    return request.post("/user/ifExist",params)
}